Fitting Nonlinear Functions to Data

genfit(vx,vy,vg,F) Returns a vector containing the parameters that make a function f of x and n parameters u1...un best approximate the data in vx and vy. The genfit function employs an optimized version of the Levenberg-Marquardt method for minimization by default. While frequently faster and less sensitive to poor guess values, this implementation may fail to converge well on problems with many local minima, such as rational functions. It is also more sensitive to incorrect derivative vectors. The optimized method allows you to solve using numerical approximations for the parameter derivatives. To change methods, right-click on the genfit function and select the desired method from the menu.

Arguments:

Gradient Operator

To improve the convergence and possibly the accuracy of genfit, you can represent F as an n + 1 vector of functions, in which the first entry is the fitting function f, and the remaining entries are the partial derivatives of f with respect to the n parameters. You can create the vector F using the gradient operator, which computes the partial derivatives of f, and the vector function stack. The following shows how to create F for the examples above:

Fitting functions with partial derivatives

Notes:

QuickSheet

Related Topics